from django import template
from django.template.defaultfilters import stringfilter
from ..utilities import get_screen_width

register = template.Library()

@register.filter
@stringfilter
def widthtruncate(input_str, max_width):
    return get_screen_width(input_str, width=max_width)
